package cn.wolfcode.rbac.mapper;

import cn.wolfcode.rbac.domain.Employee;
import cn.wolfcode.rbac.query.QueryObject;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface EmployeeMapper extends BaseMapper<Employee> {
    Integer insert(Employee record);

    int updateByPrimaryKey(Employee record);

    Employee selectByPrimaryKey(Long id);

    int selectForCount(QueryObject qo);

    List<Employee> selectForList(QueryObject qo);

    void deleteEmployeeAndRoleRelation(Long id);

    void insertEmployeeAndRoleRelation(@Param("employeeId") Long employeeId, @Param("roleId") Long roleId);

    void deleteEmployeeAndRoleRelationByRoleId(long id);

    Employee selectByUsernameAndPassword(@Param("username") String username, @Param("password") String password);
}